Skip to content

ci: Add nightly canary release for python sdk#74

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 2 commits intomainfrom
abhi-canary-nightly
Open

ci: Add nightly canary release for python sdk#74
Abhijeet Prasad (AbhiPrasad) wants to merge 2 commits intomainfrom
abhi-canary-nightly

Conversation

@AbhiPrasad
Copy link
Member

Similar to the strategy used here: braintrustdata/braintrust-sdk-javascript#1547, this PR adds a github workflow that publishes a nightly canary release for the braintrust package to Test PyPi. Read through docs/publishing.md, it has all the info you need.

We also don't publish github releases or git tags for canaries for now, but we can change that decision at a later date.

We have to do all the publishing from a single workflow because pypi trusted publishing relies on that.

#!/usr/bin/env python3
"""Template the package version module during build."""

from __future__ import annotations
Copy link
Contributor

@viadezo1er ViaDézo1er / cedric (viadezo1er) Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only annotations are str and int, so what is from __future__ import annotations used for?

@viadezo1er
Copy link
Contributor

ViaDézo1er / cedric (viadezo1er) commented Mar 13, 2026

mise exec -- python test-publish.py prepare prerelease main --run-number 1
and
mise exec -- python test-publish.py prepare prerelease NOT-A-VALID-REF --run-number 1
have the same behavior.

Meanwhile,
mise exec -- python test-publish.py prepare prerelease --run-number 1
asks for a target_ref

So one might expect mise exec -- python test-publish.py prepare prerelease NOT-A-VALID-REF --run-number 1 checks NOT-A-VALID-REF is a valid ref, but it's not the case.

I think test-publish prepare should:

  • test wether the provided ref is valid
  • or warn the user the ref isn't tested

@viadezo1er
Copy link
Contributor

ViaDézo1er / cedric (viadezo1er) commented Mar 13, 2026

--run-number n is manually set by the user, so it's a bit error prone, we might decrement or skip version number.
However I'm not sure the added check required (Github and Pypi and maybe a local registry etc...) outweighs the value of preventing this, especially since we should know what version we want to type.

@viadezo1er
Copy link
Contributor

Maybe remove the .upper() line 294 to match the behavior when writing to a file (when the flag --github-output is passed)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants